function [ net] = runInnerLearningLoop(net,Dstates,Dactions,DnextState)
% sub sample D's
subSampleSize = ceil(0.5*size(Dstates,2));
ids = randi(size(Dstates,2),1,subSampleSize);
Q = zeros(size(ids));
% run Bellman
for i=1:size(ids,2)    
    Q(i) = runBellmanUpdate(net,Dstates(:,ids(i)),DnextState(:,ids(i)));
end    
% run nn update
net = updateApproximation(net,Dstates(:,ids(:)),Dactions(:,ids(:)),Q);
end

